package com.example.config;

import com.github.pagehelper.PageInterceptor;
import org.apache.ibatis.plugin.Interceptor;
import org.mybatis.spring.annotation.MapperScan;
/*import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;*/
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration
@MapperScan("com.example.mapper") // 替换为你的Mapper接口所在的包路径
public class MyBatisConfig {

    @Bean
    @ConfigurationProperties(prefix = "pagehelper")
    public PageInterceptor pageInterceptor() {
        PageInterceptor pageInterceptor = new PageInterceptor();
        return pageInterceptor;
    }
/*
    @Bean
    public ConfigurationCustomizer configurationCustomizer() {
        return configuration -> configuration.setMapUnderscoreToCamelCase(true);
    }*/

    //不知道为啥yaml不起作用了，在这里配置才有用
}

